﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Asistente.Model.General;

namespace Asistente.Model.COSMIC
{
    public class DataMovement:IMeasurable
    {
        public InterestObject InterestObject {get;set;}

        public DataMovementType Type{get;set;}

        public DataMovement(DataMovementType type, InterestObject io)
        {
            this.Type = type;
            this.InterestObject = io;
        }

        public int Measure()
        {
            Int32 size=0;
            switch (Type)
            {
                case DataMovementType.Entry:
                    size = 1;
                    break;
                case DataMovementType.Exit:
                    size = 1;
                    break;
                case DataMovementType.Read:
                    size = 1;
                    break;
                case DataMovementType.Write:
                    size = 1;
                    break;
            }
            return size;
        }
        public override string ToString()
        {
            StringBuilder content = new StringBuilder();
            content.Append("<td>");
            content.Append(this.Type);
            content.Append("</td>");
            content.Append("<td>");
            content.Append(this.InterestObject.Name);
            content.Append("</td>");
            return content.ToString();
        }
    }
        public enum DataMovementType
        {
            Entry,
            Exit,
            Read,
            Write
        }
    
}
